﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XingFuStudio.Pioneer.Applications.City.Shop {
    /// <summary>
    /// 海运商品
    /// </summary>
    public class ShipShopInfo : ShopItem {

        /// <summary>
        /// 航行时间（以分钟为单位）
        /// </summary>
        public int TransTimes {
            get;
            set;
        }

        /// <summary>
        /// 腐败时间（以分钟为单位）
        /// </summary>
        public int FadeTimes {
            get;
            set;
        }

        /// <summary>
        /// 收获的货物数量
        /// </summary>
        public int Goods {
            get;
            set;
        }

        /// <summary>
        /// 等级
        /// </summary>
        public int Level {
            get;
            set;
        }

        /// <summary>
        /// 初始化商品自身数据
        /// </summary>
        /// <param name="shopItems"></param>
        public override void InitShop(Dictionary<string, object> shopItems) {
            base.InitShop(shopItems);

            try {
                this.Price = Convert.ToInt32((string)shopItems["sellprice"]);
                this.TransTimes = Convert.ToInt32((string)shopItems["transtime"]);
                this.FadeTimes = Convert.ToInt32((string)shopItems["fadetime"]);
                this.Goods = Convert.ToInt32((string)shopItems["goodsnum"]);
            } catch {
            }
        }
    }
}
